//
//  FileEntity.h
//  TcpTest_Client
//
//  Created by scarlettsun on 12-8-1.
//  Copyright (c) 2012年 tencent. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Buddy.h"
#import "FileEntityDelegate.h"

/*
 EntityWaiting  ---  waiting for confirm
 EntityReceive  ---  receive 
 EntityStop    ---- stop by user
 EntityFinish ---  file finish
 */
enum EntityState {EntityWaiting = 0, EntityReject = 1, EntityReceive =2 , EntityStop = 3, EntityFinish = 4, EntityCancel = 5};  //文件头信息或者文件内容

@interface FileEntity : NSObject

@property NSUInteger senderId;
@property NSUInteger receiverId;
@property NSFileHandle *fileHandler;
@property NSURL *fileUrl;
@property NSUInteger fileSize;
@property NSUInteger fileSentSize;
@property NSUInteger fileReceiveSize;
@property NSString *photo;
@property NSInteger fileState;
@property id<FileEntityDelegate>delegate;  //文件响应代理


-(FileEntity *) initWithFilePath:(NSURL *)_filePath sender:(Buddy *)myInfo 
                      receiver:(Buddy *)peerInfo fileSize:(NSUInteger)_fileSize;

-(FileEntity *) initWithFilePath:(NSURL *)_filePath senderId:(NSUInteger )_senderId
                        receiver:(Buddy *)myInfo fileSize:(NSUInteger)_fileSize;

@end
